<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>类式</title>
</head>
<body>
    <div id="reactinit"></div>
</body>
<script src="./js/react.development.js"></script>
<script src="./js/react-dom.development.js"></script>
<script src="./js/babel.min.js"></script>
<script type="text/babel">
    class Weather extends React.Component{
        constructor(props){
            // super这个步骤不是react要求的，而是类式继承必须要求写的
            super(props)
            this.state={isHot:false}
        }
        render() {
            console.log(this);
            return <h1>天气很{this.state.isHot?'炎热':'凉快'}</h1>
        }
    }

    ReactDOM.render(<Weather/>,document.getElementById('reactinit'))
</script>
</html>